﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace WindowsGame1
{
    class GameDisplay
    {
        public int width;
        public int height;
        public bool fullscreen;
        public enum display : int { WINDOW_MODE = 0, FULLSCREEN_MODE_1280 = 1, FULLSCREEN_MODE_1366 = 2, FULLSCREEN_MODE_1920 = 3 };

        public GameDisplay(){

        }

        public int[] getViewPort()
        {
            int[] viewport = new int[2];
            viewport[0] = width;
            viewport[1] = height;
            return viewport;
        }

        public int[] getViewPort( int mode )
        {
            setWindowSize(mode);
            int[] viewport = new int[2];
            viewport[0] = width;
            viewport[1] = height;
            return viewport;
        }

        public GraphicsDeviceManager setWindow(GraphicsDeviceManager graphics, int mode)
        {
            setWindowSize(mode);
            if (graphics != null)
            {
                graphics.PreferredBackBufferWidth = width;
                graphics.PreferredBackBufferHeight = height;
                graphics.IsFullScreen = fullscreen;
            }
            return graphics;
        }

        public void setWindowSize( int mode )
        {
            switch (mode)
            {
                case (int)display.WINDOW_MODE:
                    width = 800;
                    height = 600;
                    fullscreen = false;
                    break;
                case (int)display.FULLSCREEN_MODE_1280:
                    width = 1280;
                    height = 720;
                    fullscreen = true;
                    break;
                case (int)display.FULLSCREEN_MODE_1366:
                    width = 1366;
                    height = 768;
                    fullscreen = true;
                    break;
                case (int)display.FULLSCREEN_MODE_1920:
                    width = 1920;
                    height = 1080;
                    fullscreen = true;
                    break;
            }
        }

    }
}
